import  java.io.*;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LIUYANJIAO
 * Date: 2024-05-17
 * Time: 19:04
 */
public class Main {
    public static void main(String[] args) {
        //单词平均数

        String a="Java is an objected oriented programming language";
        System.out.println(a);
        char arr[]=a.toCharArray();
        System.out.println(arr.length/2);


    }
    public static void main8(String[] args) {
        //判断回文


                String str = "";
                System.out.println("请输入一个字符串");
                Scanner input = new Scanner(System.in);
                str = input.next();

                StringBuffer sb = new StringBuffer(str);
                sb.reverse();// 将Str中的字符串倒置

                int count = 0;
                for (int i = 0; i < str.length(); i++) {
                    if (str.charAt(i) == sb.charAt(i)) {
                        count++;
                    }
                }
                if (count == str.length()) {

                    System.out.println("此字符串是一个回文字符串");
                } else {
                    System.out.println("此字符串不是一个回文字符串");
                }
            }


    public static void main7(String[] args) {
        //冒泡排序
        int arr[]={1,5,6,8,4};
        for (int i = 0; i < arr.length-1; i++) {
            for (int j = 0; j <arr.length-1 ; j++) {
                if(arr[j]>arr[j+1]){
                    int tmp=arr[j];
                    arr[j]=arr[j+1];
                    arr[j+1]=tmp;
                }
            }
        }
        for(int x:arr){
            System.out.print(x+"\t");
        }
    }
    public static void main6(String[] args) {
        //斐波那契数列f(n)=f(n-1)+f(n-2)
        int arr[]=new int[10];
        arr[0]=1;arr[1]=1;
        for (int i = 2; i < 10; i++) {
            arr[i]=arr[i-1]+arr[i-2];
        }
        for(int x:arr){
            System.out.print(x+"\t");
        }
    }

    public static void main5(String[] args) {
        int a[]=new int[5];
        int arr1[][]=new int [3][4];
        a[0]=10;
        a[1]=10+a[0];
        a[2]=30;
        a[3]=40;
        a[4]=a[1]+a[2];
        arr1[0][0]=0;arr1[0][1]=1;arr1[0][2]=2;
        arr1[1][0]=3;arr1[1][1]=4;arr1[1][2]=5;
        arr1[2][0]=6;arr1[2][1]=7;arr1[2][2]=8;
        System.out.println("a[" +0+"]="+a[0]);
        System.out.println("a[" +1+"]="+a[1]);
        System.out.println("a[" +2+"]="+a[2]);
        System.out.println("a[" +3+"]="+a[3]);
        System.out.println("a[" +4+"]="+a[4]);
        System.out.println("arr1("+0+","+0+")="+arr1[0][0]);
        System.out.println("arr1("+0+","+1+")="+arr1[0][1]);
        System.out.println("arr1("+0+","+2+")="+arr1[0][2]);
        System.out.println("arr1("+1+","+0+")="+arr1[1][0]);
        System.out.println("arr1("+1+","+1+")="+arr1[1][1]);
        System.out.println("arr1("+1+","+2+")="+arr1[1][2]);
    }
    public static void main4(String[] args) {
        //找100~500以内的所有质数
        int n=0;
        for (int i = 100; i <= 500; i++) {
            for(int j=2;j<Math.sqrt(i);j++){
                if(i%j!=0&&j>Math.sqrt(i)-1){
                    System.out.print(i+"\t");
                    n++;
                    if(n%10==0) System.out.println("");
                } else if (i%j==0) {
                    break;
                }
            }
        }
    }
    public static void main3(String[] args) {
        //do while 循环
        int sum=0;
        int a=1;
        do{
            sum+=a;
        }while(++a<=100);
        System.out.println("1+2+3+...+100="+sum);
    }
    public static void main2(String[] args) throws IOException {
        //while 循环
        char ch;
        System.out.println("按1、2、3数字键可得大奖！");
        System.out.println("按空格键后回车可退出循环！");

        while((ch=(char)System.in.read())!=' '){
            System.in.skip(2);
            switch(ch){
                case '1':
                    System.out.println("恭喜你获得大奖，一辆汽车！");
                    break;
                case '2':
                    System.out.println("不错呀，你得到一台笔记本电脑！");
                    break;
                case '3':
                    System.out.println("没有白来，你得到一台冰箱！");
                    break;
                default:
                    System.out.println("真不幸，你没有奖品！下次再来吧。");

            }
        }
    }
    public static void main1(String[] args) {
        //for 循环
        int h,c;
        System.out.println("摄氏温度 华氏温度");
        for (c = 0; c < 40; c+=5) {
            h=c*9/5+32;
            System.out.println(" "+c+"        "+h);
        }
    }
}